package cn.changein.framework.core.auth.userdetail;

import cn.changein.framework.base.auth.model.LoginUser;
import cn.changein.framework.base.auth.service.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

/**
 * 登录用户详情信息获取

 * @date: 2020-02-11
 * @copyright: 广州澄境科技有限公司
 */
@Service("jwtUserDetailsService")
public class JwtUserDetailsServiceImpl implements UserDetailsService {

    @Autowired
    private AuthService authService;

    @Override
    public LoginUser loadUserByUsername(String username) throws UsernameNotFoundException {
        return authService.user(username);
    }
    
}
